package top.goldenyear.porpoise.framework.orm.core.listener;

import com.easy.query.core.configuration.QueryConfiguration;
import org.noear.solon.annotation.Component;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Inject;
import org.noear.solon.core.event.EventListener;
import top.goldenyear.porpoise.framework.orm.core.converter.JsonConverter;

/**
 * @author airhead
 */
@Configuration
@Component
public class EasyQueryConfigListener implements EventListener<QueryConfiguration> {
  @Inject private JsonConverter jsonConverter;

  @Override
  public void onEvent(QueryConfiguration queryConfiguration) throws Throwable {
    queryConfiguration.applyValueConverter(jsonConverter);
  }
}
